/**
 * InfoFrameBase.java
 *
 * Roslan's Remake of MOO in 3D using Ardor3D
 * (C) 2010-2012 Roslan Amir. All rights reserved.
 */

package name.roslan.games.moo3d.ui;

import com.ardor3d.extension.ui.UIFrame;
import com.ardor3d.extension.ui.UIPanel;
import com.ardor3d.extension.ui.backdrop.UIBackdrop;
import com.ardor3d.extension.ui.layout.RowLayout;

/**
 * The base class for all information panels.
 * 
 * @author Roslan Amir
 * @version 1.0 - Jan 17, 2011
 */
public abstract class InfoFrameBase extends UIFrame {

    /**
     * The <code>UIPanel</code> instance which is the main panel for all the widgets.
     */
    protected final UIPanel infoPanel;

    /**
     * Constructor.
     * 
     * @param title - the title of the frame
     * @param backDrop - the backdrop to use
     */
    public InfoFrameBase(String title, UIBackdrop backDrop) {
        super(title);
        this.setName(title);

        // UIFrameBar titleBar = this.getTitleBar();
        // titleBar.setFontStyles(FONT_STYLES);
        // titleBar.setMargin(FRAME_INSETS);
        this.setUseStandin(true);
        this.setOpacity(0.75f);
        this.setBackdrop(backDrop);

        /*
         * Create the Panel.
         */
        infoPanel = new UIPanel();
        infoPanel.setLayout(new RowLayout(false));
        // infoPanel.setPadding(PADDING_2000);
        this.setContentPanel(infoPanel);
    }

    /**
     * Comment for method.
     */
    protected void updateAndpack() {
        this.layout();
        this.updateMinimumSizeFromContents();
        this.pack();
    }

}
